go to previous page   go to home page   go to next page

Answer:

No.


HEX Dump

hex dump of a file

The screen shot shows the bit pattern in each byte of intData.dat. This is sometimes called a hex dump because it shows bit patterns using two hexadecimal characters per byte. On a Unix system use the "od" command at the command line. On a Windows system use a freeware hex dump. The dump above is by the IrfanView image viewing program, a very useful program to have around. Look for it at www.irfanview.net. (One of the programming exercises for Chapter 86 has you write a hex dump program.)

The eight zeros followed by a colon at the beginning of the line designate byte zero of the file. I drew in the red brackets under the bytes for each int. Four ints were written to the file, so there are four brackets.

Notice that nothing separates the ints! The bit pattern of one int follows the next with nothing in between. The spaces in the hex dump are for display purposes and do not correspond to anything in the file.

The stuff at the right of the line is an attempt to interpret the individual bytes of the file as characters. For a text file, you would see the characters the bytes correspond to. However, in our file none of the bytes make sensible characters.


QUESTION 6:

In a hex dump, each byte is represented with two characters. Each character is one of the 16 characters 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. How many two-character combinations are possible?